package BLL.User;

import BIZ.UserBiz;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

@WebServlet(name = "ForgetPwd2", value = "/ForgetPwd2")
public class ForgetPwd2 extends HttpServlet {
    private static final long serialVersionUID = 1L;

    public ForgetPwd2() {
        super();
    }

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        HttpSession session = request.getSession();


        //从表单获取邮箱
        String UserName = new String(request.getParameter("UserName").getBytes(StandardCharsets.UTF_8));
        String Password = new String(request.getParameter("NewPassword").getBytes(StandardCharsets.UTF_8));

        UserBiz userBiz = new UserBiz();

            Boolean User = userBiz.ChangePassword(Password, UserName);

    }

    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

}
